/*
 * Copyright (c) 2010-2011 Josef Hardi <josef.hardi@gmail.com>
 * Copyright (c) 2010 Piotr Zagawa <piotr.zagawa@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package id.duapuluhdua.dakidaki.service;

import android.content.Context;
import android.os.Bundle;

/**
 *
 */
public class ServiceCommand
{
  /** Constants */
  public final static int CMD_NONE = 0;
  public final static int CMD_TRACK_RECORDING_RESUME = 1;
  public final static int CMD_TRACK_RECORDING_PAUSE = 2;
  public final static int CMD_START_SERVICE = 3;

  private final static String[] vecCommand = {
      "CMD_NONE",
      "CMD_TRACK_RECORDING_RESUME",
      "CMD_TRACK_RECORDING_PAUSE",
      "CMD_START_SERVICE"
  };

  /** Fields */
  private static Context context;

  private int mCommand = CMD_NONE;
  private long mValue;
  private String mValueString;

  /**
   *
   *
   * @param command
   * @param value
   * @param valueString
   */
  public ServiceCommand(int command, long value, String valueString)
  {
    mCommand = command;
    mValue = value;
    mValueString = valueString;

    Bundle data = new Bundle();

    // data.putBoolean(getCommandString(iCommand), true);
    //
    // data.putLong(PARAM_VALUE_LONG, lValue);
    // data.putString(PARAM_VALUE_STRING, sValue);
    //
    // //update service
    // Intent intent = new Intent(context, TripComputerService.class);
    // intent.putExtras(data);
    //
    // if (iCommand == CMD_START_SERVICE)
    // {
    // context.stopService(intent);
    // }
    //
    // context.startService(intent);
  }

  public static void init(Context context)
  {
    ServiceCommand.context = context;
  }

  /**
   * @param cmdStartService
   */
  public static void send(int command)
  {
    ServiceCommand cmd = new ServiceCommand(command, -1, null);
    cmd.getValueLong();
  }

  /**
   *
   * @param command
   * @param value
   * @param valueString
   */
  public static void send(int command, long value, String valueString)
  {
    ServiceCommand cmd = new ServiceCommand(command, value, valueString);
    cmd.getValueLong();
  }

  /**
   *
   * @return
   */
  public long getValueLong()
  {
    return mValue;
  }

  /**
   *
   * @return
   */
  public String getValueString()
  {
    return mValueString;
  }
}
